package CreationPattern.Builder;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname : PhoneDirector
 * @Description : 导演类（可以获取多种型号的产品，型号的不同来自产品基本方法的不同组合和顺序）
 * @Author : chentianyu
 * @Date 2023/1/22 23:42
 */


public class PhoneDirector {
    private List<String> sequence = new ArrayList<>();
    private HUAWEIBuilder huaweiBuilder = new HUAWEIBuilder();
    private XIAOMIBuilder xiaomiBuilder = new XIAOMIBuilder();

    // 华为手机AC型号
    public AbstractPhone huaweiAC() {
        sequence.clear();
        sequence.add("A");
        sequence.add("C");
        huaweiBuilder.setSequence(sequence);
        return huaweiBuilder.getPhone();
    }

    // 华为手机ABC型号
    public AbstractPhone huaweiABC() {
        sequence.clear();
        sequence.add("A");
        sequence.add("B");
        sequence.add("C");
        huaweiBuilder.setSequence(sequence);
        return huaweiBuilder.getPhone();
    }

    // 华为手机CBA型号
    public AbstractPhone huaweiCBA() {
        sequence.clear();
        sequence.add("C");
        sequence.add("B");
        sequence.add("A");
        huaweiBuilder.setSequence(sequence);
        return huaweiBuilder.getPhone();
    }

    // 小米手机AC型号
    public AbstractPhone xiaomiAC() {
        sequence.clear();
        sequence.add("A");
        sequence.add("C");
        xiaomiBuilder.setSequence(sequence);
        return xiaomiBuilder.getPhone();
    }

    // 小米手机ABC型号
    public AbstractPhone xiaomiABC() {
        sequence.clear();
        sequence.add("A");
        sequence.add("B");
        sequence.add("C");
        xiaomiBuilder.setSequence(sequence);
        return xiaomiBuilder.getPhone();
    }

    // 小米手机CBA型号
    public AbstractPhone xiaomiCBA() {
        sequence.clear();
        sequence.add("C");
        sequence.add("B");
        sequence.add("A");
        xiaomiBuilder.setSequence(sequence);
        return xiaomiBuilder.getPhone();
    }



}
